package com.tc.gateway.tunnel;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class MultiConnection {
	MultiCast server;
	MultiCast client;
	boolean isserver;
	public MultiConnection(boolean is) throws IOException{
		super();
		this.isserver = is;
		server = new MultiCast("228.9.6.8",8888, is);
		client = new MultiCast("228.9.6.9", 9999, !is);
	}


	public InputStream getInputStream() {
		if(isserver)
			return server.getInputStream();
		else
			return client.getInputStream();
	}


	public OutputStream getOutputStream() {
		if(isserver)
			return client.getOutputStream();
		return server.getOutputStream();
	}
}
